import os
import yaml


class Config:
    config: dict

    def __init__(self):

        config_file = os.path.abspath(
            os.path.join(os.path.dirname(__file__),"..", "..", "..", "config", "env.yaml")
        )
        with open(config_file, 'r', encoding='utf-8') as file:
            self.config = yaml.safe_load(file)


    def __getitem__(self, key):
        if key in self.config:
            return self.config[key]
        else:
            return None

config = Config()
